package study.actorOf

import akka.actor.Actor
import study.msg.{Fire, Push}

/**
 * @Description: TODO
 * @Author: DJJ
 * @Date: 2019/12/12 15:36
 */
class Shop extends Actor{
  override def receive: Receive = {
    case Push(msg)=>println("Shop 接收到消息:"+msg)

    case Fire(masg)=>

      /**
       *  因为是子的actor所以得带上父的actor name
       */
     // val unit = context.actorSelection("/user/TEST1/Shop")
      println(context.parent)
      val unit = context.actorSelection("/user/*")
      unit ! Push("hello")
  }
}
